import React, { useRef, useEffect, forwardRef } from 'react'
import { useGLTF, useAnimations } from '@react-three/drei'

const AirStopping = forwardRef((props, ref) => {
  const { nodes, materials, animations } = useGLTF('/models/airStopping.glb')
  const { actions } = useAnimations(animations, ref)
  useEffect(() => {
    for (const k in actions) {
      actions[k].play()
    }
  }, [actions]);
  return (
    <group visible={false} ref={ref} scale={0.001} dispose={null} >
      <group scale={3.2} position={[0, 3.2, 0]}>
        <mesh geometry={nodes.柱体.geometry} material={materials['材质.001']} rotation={[0, 0, -Math.PI / 2]} scale={[0.896045, 1.553329, 1.314384]} />
        <group position={[-1.564061, -0.132163, 0.000023]} scale={[0.011228, 1.193928, 0.013213]}>
          <mesh geometry={nodes.立方体002_1.geometry} material={materials['材质.003']} />
          <mesh geometry={nodes.立方体002_2.geometry} material={materials['材质.002']} />
          <mesh geometry={nodes.立方体002_3.geometry} material={materials.材质} />
          <mesh geometry={nodes.立方体002_4.geometry} material={materials['材质.005']} />
        </group>
      </group>
    </group>
  )
})

useGLTF.preload('/models/airStopping.glb')

export default AirStopping;
